package cc.vv.baselibrary.util

import android.util.Log

import java.lang.reflect.ParameterizedType

/**
 * @author Zml
 * @date 2018/7/26.
 */
object CareateUtil {
    internal fun <T> getT(o: Any, i: Int): T? {
        try {
            return ((o.javaClass.genericSuperclass as ParameterizedType).actualTypeArguments[i] as Class<T>).newInstance()
        } catch (e: Exception) {
            e.printStackTrace()
            Log.e("CareateUtil", "---转换异常---" + e.message)
        }
        return null
    }

}
